<template>
  <el-tabs v-model="activeName">
    <el-tab-pane :label="list[0].label" :name="list[0].name">
      <slot name="a0"></slot>
    </el-tab-pane>
    <el-tab-pane :label="list[1].label" :name="list[1].name">
      <slot name="a1"></slot>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
export default {
  name: "myTabs",
  props: {
    list: {
      type: Array,
      default: () => {
        return [
          { name: "one", label: "one" },
          { name: "two", label: "two" }
        ];
      }
    },
    defaultname: {
      type: String
    }
  },
  data() {
    return {
      activeName: ""
    };
  },
  created() {
    this.activeName = this.defaultname;
  }
};
</script>
